package admin;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import shop.*;
import admin.*;

import com.opensymphony.xwork2.ActionSupport;
import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

import java.util.*;
import java.io.Reader;
import java.io.IOException;

import member.Memberbean;
import java.sql.Date;

public class AdminOrderModifyAction extends ActionSupport{

	public static Reader reader;
	public static SqlMapClient sqlMapper;
	
	private OrderBean result;
	private int ORDER_NUM;
	private String ORDER_TRANS_NUM;
	private Date ORDER_TRADE_DATE;
	private int ORDER_STATUS;
	
	
	public AdminOrderModifyAction() throws IOException {
		reader = Resources.getResourceAsReader("sqlMapConfig.xml");
		sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader);
		reader.close();

	}
	
	public String execute() throws Exception {
		
		result = new OrderBean();
		
		result.setORDER_NUM(ORDER_NUM);
		
		result = (OrderBean)sqlMapper.queryForObject("infoOrderdmin",ORDER_NUM);
		
		result.setORDER_TRANS_NUM(getORDER_TRANS_NUM());
		result.setORDER_STATUS(getORDER_STATUS());
		
		sqlMapper.update("modifyOrderadmin",result);
		
		return SUCCESS;
	}

	public OrderBean getResult() {
		return result;
	}
	public void setResult(OrderBean result) {
		this.result = result;
	}
	public int getORDER_NUM() {
		return ORDER_NUM;
	}
	public void setORDER_NUM(int ORDER_NUM) {
		this.ORDER_NUM = ORDER_NUM;
	}
	public String getORDER_TRANS_NUM() {
		return ORDER_TRANS_NUM;
	}
	public void setORDER_TRANS_NUM(String ORDER_TRANS_NUM) {
		this.ORDER_TRANS_NUM = ORDER_TRANS_NUM;
	}
	public Date getORDER_TRADE_DATE() {
		return ORDER_TRADE_DATE;
	}
	public void setORDER_TRADE_DATE(Date ORDER_TRADE_DATE) {
		this.ORDER_TRADE_DATE = ORDER_TRADE_DATE;
	}
	public int getORDER_STATUS() {
		return ORDER_STATUS;
	}
	public void setORDER_STATUS(int ORDER_STATUS) {
		this.ORDER_STATUS = ORDER_STATUS;
	}
}